<?php
// +----------------------------------------------------------------------
// | 日志模型
// +----------------------------------------------------------------------
// | @link ( http://www.yurnero.net )
// +----------------------------------------------------------------------
// | @copyright
// +----------------------------------------------------------------------
// | @licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | @author Haijun Wu <nicholasinlove@126.com>
// +----------------------------------------------------------------------
// | $Id: PostsModel.class.php 122 2011-05-18 09:00:37Z nicholasinlove1986@gmail.com $
// +----------------------------------------------------------------------


import('RelationModel');
class PostsModel extends RelationModel {

	protected $_link=array(
		'Category'=>array(
			'mapping_type'=>BELONGS_TO,
			'class_name'=>'Category',
			'foreign_key'=>'category_id',
			'mapping_name'=>'category',
			'mapping_fields'=>'category_title', 
			'as_fields'=>'category_title',
		),
		 /*'Comment'=>array(
			'mapping_type'=>HAS_MANY,
			'class_name'=>'Comment',
			'foreign_key'=>'posts_id',
			'mapping_name'=>'commentlist',
			'condition'=>'comment_status = 1 AND comment_visible = 1',
		 ),
		 'Trackback'=>array(
			'mapping_type'=>HAS_MANY,
			'class_name'=>'Trackback',
			'foreign_key'=>'posts_id',
			'mapping_name'=>'trackbacklist',
			'condition'=>'tb_visible = 1',
		 ),*/
	);
	
}

?>